﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Users.aspx.cs" Inherits="Web.Users" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="server">

    <link rel="stylesheet" href="Share/Styles/Users.css" />

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="Main" runat="server">

    <section id="UsersFiters" class="inset-shadow box clear-fix filter">

        <div class="wrapper left">
            <asp:DropDownList runat="server" ID="DdlRolesFilter" AutoPostBack="True" OnSelectedIndexChanged="DdlRolesFilter_OnSelectedIndexChanged" />
        </div>

    </section>

    <asp:UpdatePanel runat="server" ID="UpdatePanelStudyYearsJournal">
        <ContentTemplate>

            <section id="UsersSection" class="inset-shadow box clear-fix">

                <asp:ListView runat="server" ID="ListViewUsers" DataKeyNames="Id">

                    <LayoutTemplate>
                        <asp:PlaceHolder ID="ItemPlaceholder" runat="server" />
                    </LayoutTemplate>

                    <ItemTemplate>
                        <section class="user border-top-silver clear-fix">
                            <div class="left">
                                <a href='/Profile.aspx?UserId=<%# Eval("Id") %>'>
                                <img src='<%# Eval("AvatarUrl") %>' alt='<%# Eval("Fio") %>' />    
                                </a>
                            </div>
                            <div class="left">
                                <a href='/Profile.aspx?UserId=<%# Eval("Id") %>' class="fio"><%# Eval("Fio") %></a>
                                (<a href='/Profile.aspx?UserId=<%# Eval("Id") %>' class=""><%# Eval("Login") %></a>)
                                
                                <asp:Label runat="server" Visible='<%# Eval("IsAdmin") %>' Text="<b>Администратор</b>" />

                                <asp:Label runat="server" Visible='<%# Eval("IsTDW") %>' Text="<b>Работник учебного отдела</b>" />

                                <asp:Label runat="server" Visible='<%# Eval("IsTeacher") %>' Text="<b>Преподаватель</b>" />
                                <asp:Label runat="server" Visible='<%# Eval("IsTeacher") %>' Text='<%# string.Format("<b>Преподает</b>: {0}", Eval("TeacherSubjects")) %>'></asp:Label>
                                <asp:Label runat="server" Visible='<%# Eval("IsCurator") %>' Text='<%# string.Format("<b>Куратор группы</b> <a href=\"/Groups.aspx?GroupId={1}\">{0}</a>", Eval("GroupName"), Eval("GroupId")) %>' />

                                <asp:Label runat="server" Visible='<%# Eval("IsStudent") %>' Text='<%# string.Format("<b>Студент группы</b> <a href=\"/Groups.aspx?GroupId={1}\">{0}</a>", Eval("GroupName"), Eval("GroupId")) %>' />
                                <asp:Label runat="server" Visible='<%# Eval("IsPraepostor") %>' Text="<b>Староста группы</b>" />
                                <asp:Label runat="server" Visible='<%# Eval("IsStudent") %>' Text='<%# string.Format("<b>Родитель</b>: <a href=\"/Profile.aspx?UserId={1}\">{0}</a>", Eval("ParentFio"), Eval("ParentId")) %>' />
                                
                                <asp:Label runat="server" Visible='<%# Eval("IsParent") %>' Text="<b>Родитель</b>" />
                                <asp:Label runat="server" Visible='<%# Eval("IsParent") %>' Text='<%# string.Format("<b>Ребенок</b>: <a href=\"/Profile.aspx?UserId={1}\">{0}</a>", Eval("ChildName"), Eval("ChildId")) %>' />
                            </div>
                            <div class="right-top clear-fix">
                                <div runat="server" class="cud-links" visible='<%# Eval("ToApproveVisible") %>'>
                                    <asp:LinkButton runat="server" ID="BtnApprove" Text="Подтвердить регистрацию" OnClick="BtnApprove_OnClick" />
                                </div>
                            </div>
                        </section>
                    </ItemTemplate>

                    <EmptyDataTemplate>
                        Нет пользователей с данной ролью
                    </EmptyDataTemplate>

                </asp:ListView>

            </section>

        </ContentTemplate>
    </asp:UpdatePanel>

</asp:Content>
